package pl.com.qapps.datastore.base;

import java.util.LinkedList;
import java.util.List;

import pl.com.qapps.datastore.berkeley.LazyIterableWrapper;

import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.FetchOptions;
import com.google.appengine.api.datastore.Key;

public class KeyFetchQueryResult implements QueryResult {

	private final KeySource source;
	private final List<Key> keys = new LinkedList<Key>();

	public KeyFetchQueryResult(FetchOptions opts, KeySource source) {
		this.source = source;
		
		Key fetchedKey = null;
		while ((fetchedKey = source.next()) != null) {
			keys.add(fetchedKey);
		}
	}

	@Override
	public int getSkippedResults() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int resultSize() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Iterable<Entity> results() {
		throw new UnsupportedOperationException("not supported yet");
	}

}
